export default {
  tooltip: {
    trigger: "axis",
    order: "valueAsc",
    enterable: true,
    showContent: true,
    className: "setSingleDataBg",
    triggerOn: "mousemove",
    axisPointer: {
      type: "cross",
      label: {
        backgroundColor: "#1a2995"
      }
    }
  },
  grid: {
    right: 30
  },
  legend: {
    textStyle: {
      //图例文字的样式
      fontSize: 13
    },
    data: ["Train_loss", "Test_loss"]
  },
  xAxis: {
    type: "category",
    data: [] as any
  },
  yAxis: {
    max: "dataMax",
    min: 0
  },
  //下载图片
  toolbox: {
    feature: {
      saveAsImage: {},
      myFull: {
        show: true,
        title: "全屏",
        icon: "image:///public/fullScreen.png",
        onclick: (e) => {
          let domName = document.getElementById("main")!
          // 全屏查看
          if (domName.requestFullScreen) {
            // HTML W3C 提议
            domName.requestFullScreen()
          } else if (domName.msRequestFullscreen) {
            // IE11
            domName.msRequestFullScreen()
          } else if (domName.webkitRequestFullScreen) {
            // Webkit
            domName.webkitRequestFullScreen()
          } else if (domName.mozRequestFullScreen) {
            // Firefox
            domName.mozRequestFullScreen()
          }
          // 退出全屏
          if (domName.requestFullScreen) {
            document.exitFullscreen()
          } else if (domName.msRequestFullScreen) {
            document.msExitFullscreen()
          } else if (domName.webkitRequestFullScreen) {
            document.webkitCancelFullScreen()
          } else if (domName.mozRequestFullScreen) {
            document.mozCancelFullScreen()
          }
        }
      }
    }
  },
  series: [
    {
      name: "Train_loss",
      data: [] as any,
      type: "line"
    },
    {
      name: "Test_loss",
      data: [] as any,
      type: "line"
    }
  ]
}
